import request from '@/utils/request'
export function fetchList(parentId, params) {
    return request({
        url: '/partition/list/' + parentId,
        method: 'get',
        params: params
    })
}
export function deletePartition(id) {
    return request({
        url: '/partition/delete/' + id,
        method: 'post'
    })
}

export function createPartition(data) {
    return request({
        url: '/partition/create',
        method: 'post',
        data: data
    })
}

export function updatePartition(id, data) {
    return request({
        url: '/partition/update/' + id,
        method: 'post',
        data: data
    })
}

export function getPartition(id) {
    return request({
        url: '/partition/' + id,
        method: 'get',
    })
}

export function fetchListWithChildren() {
    return request({
        url: '/partition/list/withChildren',
        method: 'get'
    })
}